/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.totoBD.gui.swing.components.dialog;

import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;

/**
 *
 * @author rgil
 */
public class DlgConDbDrop extends DlgConDbAbs implements ActionListener{

    public DlgConDbDrop(Frame parent, boolean modal) throws Exception{
        super("Drop a database", "Enter the name of the database to drop", parent, modal);
    }

    protected boolean _doJob() throws Exception{
       String DataBaseName = super.txfDataBaseName.getText();
       try{
            this._dbConnection_.executeUpdate("DROP DATABASE "+ DataBaseName);
            return true;
            }
        catch( SQLException ex ) {
            DlgBoxError dlg = new DlgBoxError(ex.getMessage());
            ex.printStackTrace();
            return false;
        }
        catch( Exception ex ) {
            DlgBoxError dlg = new DlgBoxError(ex.getMessage());
            ex.printStackTrace();
            return false;
        }
    }
    @Override
    public void actionPerformed(ActionEvent e){
        super.actionPerformed(e);
    }

    
    
}
